package com.sky.context;
// 线程池类
public class BaseContext {
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    // 将用户id保存到当前线程池
    public static void setCurrentId(Long id){
        threadLocal.set(id);
    }

    //获取当前线程的id
    public static Long getCurrentId(){
        return threadLocal.get();
    }
    // 删除当前线程池
    public static void removeCurrentId(){
        threadLocal.remove();
    }
}
